import express from "express";
import poisRouter from "./pois.js"; // 导入专用POI路由
import authRouter from "./auth.js";
import { authenticateToken } from "../middleware/auth.js";

export default (db) => {
  const router = express.Router();
  router.use((req, res, next) => {
    req.db = db;
    next();
  });
  // POI路由
  router.use("/pois", poisRouter(db));
  // 认证路由
  router.use("/auth", authRouter);

  return router;
};
